package a.f.h.a.b;

import a.c.*;
import a.c.d;
import a.c.e;
import a.c.m;
import a.c.q;
import a.f.h.a.a.f;
import a.f.h.a.a.g;

public class k
{
  private b a;
  private q b;
  private a.f.h.a.a.b c;
  private n d;
  private d f;
  private d g;
  private d h;
  private boolean i = true;
  private ab k;
  public static boolean l;
  
  public k(b paramb)
  {
    this.a = paramb;
    this.b = this.a.d();
    this.c = this.a.b();
  }
  
  public void a()
  {
    if ((b.i) || (this.d != null)) {
      this.d.a();
    }
  }
  
  public void a(boolean paramBoolean)
  {
    this.i = paramBoolean;
  }
  
  public boolean c()
  {
    return this.i;
  }
  
  public static void a(b paramb, d paramd)
  {
    k localk = new k(paramb);
    localk.i = false;
    localk.a(new ab(paramd));
    localk.a();
  }
  
  public static boolean c(b paramb, d paramd)
  {
    ab localab1 = new ab();
    ab localab2 = paramb.d(paramd);
    k localk = new k(paramb);
    localk.d = new n(paramb);
    localk.i = false;
    double d1 = localk.d.a(paramd, localab1);
    localk.a();
    if (!b.i) {
      if (d1 > localab2.size()) {
        return false;
      }
    }
    return true;
  }
  
  public void a(ab paramab)
  {
    boolean bool = b.i;
    int j = b.h;
    m localm = paramab.l();
    if (localm.e()) {
      if (!bool)
      {
        if (this.d == null) {
          this.d = new n(this.a);
        }
        this.h = localm.a();
      }
    }
    label121:
    label125:
    while (bool)
    {
      if (!bool) {
        if (this.h.g())
        {
          a(this.h);
          if (bool) {
            break label125;
          }
          if (j == 0) {
            break label121;
          }
        }
      }
      ab localab = this.d.a(this.h.e(), this.h.f());
      b(localab);
      if (!bool)
      {
        if (!this.i)
        {
          this.d.a();
          this.d = null;
        }
        localm.f();
      }
      if (j == 0) {
        break;
      }
    }
  }
  
  private void a(d paramd)
  {
    e locale = paramd.e();
    d locald1 = this.a.k(paramd);
    ab localab = this.a.a(locale);
    localab.a(paramd);
    if (!b.i)
    {
      localab.a(locald1);
      if (!this.i) {}
    }
    else
    {
      d locald2 = localab.n();
      a.f.j.n localn = this.a.b(locald2);
      a(localn, paramd);
    }
  }
  
  private void b(ab paramab)
  {
    boolean bool = b.i;
    int m = b.h;
    d locald1 = null;
    m localm = paramab.l();
    do
    {
      if (!localm.e()) {
        break;
      }
      d locald2 = localm.a();
      int j = this.d.d(locald2);
      if (!bool) {}
      switch (j)
      {
      case 0: 
        locald1 = b(locald2);
        if (!bool) {
          if (m == 0) {
            break;
          }
        }
        break;
      case 1: 
        locald1 = c(locald2);
        if (!bool) {
          if (m == 0) {
            break;
          }
        }
        break;
      case 2: 
        locald1 = f(locald2);
        if (!bool) {
          if (m == 0) {
            break;
          }
        }
        break;
      case 3: 
        locald1 = d(locald2);
        if (!bool) {
          if (m == 0) {
            break;
          }
        }
        break;
      case 4: 
        locald1 = e(locald2);
        if (!bool) {
          if (m == 0) {
            break;
          }
        }
        break;
      default: 
        throw new RuntimeException("Bad routing edge type!");
      }
      if (!bool)
      {
        if (this.i)
        {
          if (bool) {
            continue;
          }
          if (j != 0)
          {
            a.f.j.n localn = this.d.a(locald2.e());
            a(localn, locald1);
          }
        }
        localm.f();
      }
    } while (m == 0);
  }
  
  private d b(d paramd)
  {
    this.f = this.b.a(this.h.e(), this.h.f());
    d locald = a(this.h.e(), paramd.f());
    this.a.b(this.h.e(), locald, this.f);
    this.k = new ab();
    v localv = this.k.b(this.f);
    this.a.a(this.f, localv);
    this.a.b(this.f, this.h);
    return null;
  }
  
  private d c(d paramd)
  {
    this.g = this.a.k(this.f);
    d locald = a(this.h.f(), paramd.e());
    this.a.b(this.h.f(), locald, this.g);
    this.a.a(this.h, this.k);
    return this.f;
  }
  
  private d d(d paramd)
  {
    e locale = this.d.e(paramd);
    this.b.a(this.f, this.f.e(), locale);
    this.g = this.a.k(this.f);
    d locald1 = null;
    locald1 = a(locale, this.g);
    this.a.g(locale, locald1, this.g);
    d locald2 = this.f;
    this.f = this.b.a(locale, this.h.f());
    d locald3 = this.a.i(locald1);
    if (!b.i)
    {
      if (locald3.e() != locale) {
        locald3 = this.a.c(locald3);
      }
      this.a.a(locale, locald3, this.f);
      this.a.c(locald2, this.f);
    }
    v localv = this.k.b(this.f);
    this.a.a(this.f, localv);
    this.a.b(this.f, this.h);
    return locald2;
  }
  
  private d e(d paramd)
  {
    e locale = this.d.e(paramd);
    this.b.a(this.f, this.f.e(), locale);
    this.g = this.a.k(this.f);
    d locald1 = a(locale, paramd.f());
    d locald2 = this.a.i(locald1);
    if (!b.i)
    {
      if (locald2.e() != locale) {
        locald2 = this.a.c(locald2);
      }
      this.a.a(locale, locald2, this.g);
    }
    d locald3 = this.f;
    this.f = this.b.a(locale, this.h.f());
    this.a.g(locale, locald1, this.f);
    v localv = this.k.b(this.f);
    this.a.a(this.f, localv);
    this.a.b(this.f, this.h);
    this.a.c(this.f, locald3);
    return locald3;
  }
  
  private d f(d paramd)
  {
    boolean bool = b.i;
    int m = b.h;
    Object localObject1 = this.d.f(paramd);
    Object localObject2 = this.a.c((d)localObject1);
    d locald1 = null;
    d locald2 = null;
    d locald3 = null;
    d locald4 = null;
    Object localObject3 = ((d)localObject1).f();
    Object localObject4 = ((d)localObject1).e();
    e locale = null;
    Object localObject5 = this.c.a((e)localObject3);
    Object localObject6 = this.c.a((e)localObject4);
    int j = 0;
    if (!bool) {
      if (localObject6 == ((g)localObject5).a())
      {
        j = 1;
        localObject7 = localObject3;
        localObject3 = localObject4;
        localObject4 = localObject7;
        localObject8 = localObject5;
        localObject5 = localObject6;
        localObject6 = localObject8;
        localObject9 = localObject2;
        localObject2 = localObject1;
        localObject1 = localObject9;
      }
    }
    Object localObject10;
    Object localObject11;
    Object localObject12;
    if (localObject5 == ((g)localObject6).a())
    {
      locale = this.b.i();
      this.a.d(locale);
      localObject7 = this.c.a((g)localObject5, locale);
      ((g)localObject5).b((f)localObject7);
      if (!bool) {
        if (!this.a.a((d)localObject2))
        {
          localObject8 = this.a.h((d)localObject2);
          localObject9 = this.a.i((d)localObject2);
          localObject10 = this.a.e((d)localObject2);
          localObject11 = this.a.d((d)localObject10);
          this.a.C((d)localObject10);
          locald3 = this.b.a((e)localObject3, locale);
          locald1 = this.a.k(locald3);
          locald2 = this.b.a(locale, (e)localObject4);
          locald4 = this.a.k(locald2);
          this.a.b(locald3, (d)localObject10);
          this.a.b(locald2, (d)localObject10);
          localObject12 = ((ab)localObject11).a(locald3, this.a.j((d)localObject2));
          this.a.a(locald3, (v)localObject12);
          localObject12 = ((ab)localObject11).a(locald2, this.a.j((d)localObject2));
          this.a.a(locald2, (v)localObject12);
          ((ab)localObject11).remove(localObject2);
          this.a.c(locald3, (d)localObject9);
          if (bool) {
            break label725;
          }
          if (localObject8 == null) {
            break label661;
          }
          if (bool) {
            break label704;
          }
          if (this.a.i((d)localObject8) == null) {
            break label661;
          }
          this.a.c((d)localObject8, locald2);
          break label661;
        }
      }
      localObject8 = this.a.g((d)localObject1);
      localObject9 = this.a.i((d)localObject1);
      localObject10 = this.a.e((d)localObject1);
      localObject11 = this.a.d((d)localObject10);
      this.a.C((d)localObject10);
      locald1 = this.b.a(locale, (e)localObject3);
      locald3 = this.a.k(locald1);
      locald4 = this.b.a((e)localObject4, locale);
      locald2 = this.a.k(locald4);
      this.a.b(locald1, (d)localObject10);
      this.a.b(locald4, (d)localObject10);
      localObject12 = ((ab)localObject11).a(locald4, this.a.j((d)localObject1));
      this.a.a(locald4, (v)localObject12);
      localObject12 = ((ab)localObject11).a(locald1, this.a.j((d)localObject1));
      this.a.a(locald1, (v)localObject12);
      ((ab)localObject11).remove(localObject1);
      this.a.c(locald1, (d)localObject9);
      if (!bool)
      {
        if (localObject8 != null)
        {
          if (bool) {
            break label704;
          }
          if (this.a.i((d)localObject8) != null) {
            this.a.c((d)localObject8, locald4);
          }
        }
        label661:
        this.a.h((e)localObject3, (d)localObject2, locald3);
        this.a.a(locale).add(locald1);
        this.a.c((e)localObject4, (d)localObject1, locald4);
        label704:
        this.a.a(locale).add(locald2);
        g((d)localObject2);
        g((d)localObject1);
      }
    }
    else
    {
      label725:
      locale = this.b.i();
      this.a.d(locale);
      localObject7 = (g)((g)localObject5).a();
      localObject8 = this.c.a((g)localObject7, locale);
      ((g)localObject7).b((f)localObject8);
      v localv;
      if (!bool) {
        if (!this.a.a((d)localObject2))
        {
          locald3 = this.b.a((e)localObject3, locale);
          locald1 = this.a.k(locald3);
          locald2 = this.b.a(locale, (e)localObject4);
          locald4 = this.a.k(locald2);
          localObject9 = this.a.e((d)localObject2);
          if (!bool)
          {
            if (localObject9 == null)
            {
              localObject10 = new ab();
              this.a.a((d)localObject2, (ab)localObject10);
              localObject11 = ((ab)localObject10).b(locald3);
              this.a.a(locald3, (v)localObject11);
              localObject11 = ((ab)localObject10).b(locald2);
              this.a.a(locald2, (v)localObject11);
              this.a.b(locald3, (d)localObject2);
              this.a.b(locald2, (d)localObject2);
              this.a.C((d)localObject2);
              if (bool) {
                break label1584;
              }
              if (m == 0) {
                break label1531;
              }
            }
            this.a.C((d)localObject9);
          }
          localObject10 = this.a.d((d)localObject9);
          localObject11 = this.a.h((d)localObject2);
          localObject12 = this.a.g((d)localObject2);
          localv = ((ab)localObject10).a(locald3, this.a.j((d)localObject2));
          this.a.a(locald3, localv);
          localv = ((ab)localObject10).a(locald2, this.a.j((d)localObject2));
          this.a.a(locald2, localv);
          ((ab)localObject10).remove(localObject2);
          this.a.b(locald3, (d)localObject9);
          this.a.b(locald2, (d)localObject9);
          if (!bool) {
            if (localObject11 != null)
            {
              if (bool) {
                break label1123;
              }
              if (this.a.i((d)localObject11) == localObject2) {
                this.a.c((d)localObject11, locald2);
              }
            }
          }
          label1123:
          if (!bool)
          {
            if (localObject12 == null) {
              break label1531;
            }
            if (bool) {
              break label1574;
            }
          }
          if (this.a.i((d)localObject12) != localObject2) {
            break label1531;
          }
          this.a.c((d)localObject12, locald3);
          break label1531;
        }
      }
      locald4 = this.b.a((e)localObject4, locale);
      locald2 = this.a.k(locald4);
      locald1 = this.b.a(locale, (e)localObject3);
      locald3 = this.a.k(locald1);
      localObject9 = this.a.e((d)localObject1);
      if (!bool)
      {
        if (localObject9 == null)
        {
          localObject10 = new ab();
          this.a.a((d)localObject1, (ab)localObject10);
          localObject11 = ((ab)localObject10).b(locald4);
          this.a.a(locald4, (v)localObject11);
          localObject11 = ((ab)localObject10).b(locald1);
          this.a.a(locald1, (v)localObject11);
          this.a.b(locald4, (d)localObject1);
          this.a.b(locald1, (d)localObject1);
          this.a.C((d)localObject1);
          if (bool) {
            break label1584;
          }
          if (m == 0) {}
        }
        else
        {
          this.a.C((d)localObject9);
        }
      }
      else
      {
        localObject10 = this.a.d((d)localObject9);
        localObject11 = this.a.h((d)localObject1);
        localObject12 = this.a.g((d)localObject1);
        localv = ((ab)localObject10).a(locald4, this.a.j((d)localObject1));
        this.a.a(locald4, localv);
        localv = ((ab)localObject10).a(locald1, this.a.j((d)localObject1));
        this.a.a(locald1, localv);
        ((ab)localObject10).remove(localObject1);
        this.a.b(locald4, (d)localObject9);
        this.a.b(locald1, (d)localObject9);
        if (!bool) {
          if (localObject11 != null)
          {
            if (bool) {
              break label1494;
            }
            if (this.a.i((d)localObject11) == localObject1) {
              this.a.c((d)localObject11, locald1);
            }
          }
        }
        label1494:
        if (!bool)
        {
          if (localObject12 != null) {
            if (bool) {
              break label1574;
            }
          }
        }
        else if (this.a.i((d)localObject12) == localObject1) {
          this.a.c((d)localObject12, locald4);
        }
      }
      label1531:
      this.a.c((e)localObject3, (d)localObject2, locald3);
      this.a.a(locale).add(locald1);
      this.a.c((e)localObject4, (d)localObject1, locald4);
      label1574:
      label1584:
      this.a.a(locale).add(locald2);
      g((d)localObject2);
      g((d)localObject1);
    }
    this.a.C(this.h);
    this.b.a(this.f, this.f.e(), locale);
    Object localObject7 = this.f;
    Object localObject8 = this.a.k((d)localObject7);
    if (!bool)
    {
      if (j != 0) {
        this.a.a(locale, locald1, (d)localObject8);
      }
    }
    else
    {
      if (bool) {
        break label1716;
      }
      if (m == 0) {
        break label1689;
      }
    }
    this.a.a(locale, locald2, (d)localObject8);
    label1689:
    if (!bool)
    {
      this.f = this.b.a(locale, this.h.f());
      if (j != 0)
      {
        label1716:
        this.a.a(locale, locald2, this.f);
        if (bool) {
          break label1774;
        }
        if (m == 0) {
          break label1759;
        }
      }
    }
    this.a.a(locale, locald1, this.f);
    label1759:
    this.a.b(this.f, this.h);
    label1774:
    Object localObject9 = this.k.b(this.f);
    this.a.a(this.f, (v)localObject9);
    return localObject7;
  }
  
  private d a(e parame, d paramd)
  {
    boolean bool = b.i;
    int j = b.h;
    d locald;
    do
    {
      for (locald = this.a.l(paramd); j == 0; locald = this.a.l(locald))
      {
        if (locald.e() == parame) {
          break;
        }
        if (j != 0) {
          break label52;
        }
      }
    } while (bool);
    label52:
    return locald;
  }
  
  private d a(e parame1, e parame2)
  {
    boolean bool = b.i;
    d locald = null;
    a.f.j.n localn = this.d.a(parame2);
    m localm = localn.a();
    while (localm.e())
    {
      if (!bool) {
        if (localm.a().e() == parame1)
        {
          locald = localm.a();
          break;
        }
      }
      localm.f();
    }
    return locald;
  }
  
  private void a(a.f.j.n paramn, d paramd)
  {
    boolean bool = b.i;
    e locale = paramd.f();
    if (!bool) {
      if (this.a.e(locale))
      {
        arrayOfn = this.a.a(paramn, paramd, locale);
        if (bool) {
          return;
        }
        if (b.h == 0) {
          break label61;
        }
      }
    }
    a.f.j.n[] arrayOfn = this.a.a(paramn, paramd);
    label61:
    this.d.a(paramn, arrayOfn);
  }
  
  private void g(d paramd)
  {
    boolean bool = b.i;
    if (!bool) {
      if (this.a.n(paramd))
      {
        if (bool) {
          break label42;
        }
        this.b.a(paramd);
        if (b.h == 0) {
          return;
        }
      }
    }
    label42:
    this.b.f(paramd);
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.h.a.b.k

 * JD-Core Version:    0.7.0.1

 */